<?php
error_reporting(0);
$isadmin=1;
include "../comm/config.php";
include "../comm/checkpostandget.php";
include "check.php";
$id=$_GET["id"]; $link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
	die("数据库链接出错: " . mysql_error());
}
else
{
	mysql_query("set names utf8");
	$sql="select * from ".$BIAOTOU."slides where id=".$id;
	mysql_select_db($dbname);
	$rs = mysql_query($sql);
}	
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">	
function tSubmit(form){
	if(form.title.value==''){
		alert('请填写幻灯名称！');
		form.title.focus();
		return false;
	}
	if(form.url.value==''){
		alert('请填写链接地址！');
		form.url.focus();
		return false;
	}
	if(form.picname.value==''){
		alert('请上传幻灯图片！');
		return false;
	}
	if(form.wz.value==''){
		alert('请填写显示位置！');
		form.wz.focus();
		return false;
	}
	return true;
}
</script>
<style type="text/css">
<!--
.STYLE1 {
	color: #FFFFFF;
	font-weight: bold;
	font-size:14px;
	text-decoration:none;
}
.STYLE2 {
	color: #555555;
	font-weight: bold;
	font-size:14px;
	text-decoration:none;
}
-->
</style>
</head>

<body topmargin="5" leftmargin="0">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="282" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <table cellspacing="0" width="100%" height="207" style="border:1px  solid #DCEAF7;">
            <tr>
              <td height="30" colspan="2" bgcolor="E9F2FB" class="bigtext"><strong>&nbsp;<img src="images/arrow.gif" width="16" height="22" align="absmiddle" /> 修改幻灯片</strong></td>
            </tr>
            <tr>
              <td width="100%" colspan="2" valign="top"><table width="100%" height="300" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td valign="top"><form id="form1" name="form1" method="post" action="slides_chg_save.php" onsubmit="return tSubmit(this);">
<br />
<table width="720"  align="center" border=1 cellpadding=0 cellspacing=0
style="border-collapse: collapse" bordercolor="#dddddd">
                      
					  <?php
					  while ($row = mysql_fetch_array($rs))
					{?>
                      <tr>
                        <td width="131" height="30" align="right" class="bigtext">幻灯标题：</td>
                        <td height="30">&nbsp;<input type="text" name="title" class="btn3" value="<?php echo $row["title"]; ?>" style="width:400px;" />
                        <input type="hidden" name="id"  value="<?php echo $row["id"]; ?>"/></td>
                      </tr>
					   <tr>
                        <td height="30" align="right" class="bigtext">链接地址：</td>
                        <td height="30">&nbsp;<input type="text" name="url" class="btn3" value="<?php echo $row["url"]; ?>" style="width:400px;" /></td>
                      </tr>
					  <tr>
                        <td height="30" align="right" class="bigtext">幻灯图片：</td>
                        <td height="30" class="bigtext">&nbsp;<IFRAME frameBorder=0 
                        height=25 name=ad scrolling=no 
                        src="uppic.php?pic=<?=$row["pic"]?>" 
                        width="98%"></IFRAME>                        </td>
                        </tr>
					  <tr>
                        <td height="30" align="right" class="bigtext">显示位置：</td>
                        <td height="30" class="bigtext">&nbsp;<input type="text" name="wz" class="btn3" value="<?php echo $row["wz"]; ?>" style="width:200px;" />
                        （只能填数字）</td>
                      </tr>
					  <tr>
                        <td height="30" align="right" class="bigtext">显示隐藏：</td>
                        <td height="30" class="bigtext">&nbsp;<select name="hide">						
						<option value="0" <?php if($row["hide"]==0) echo " selected"?>>显示</option>
						<option value="1" <?php if($row["hide"]==1) echo " selected"?>>隐藏</option>
						</select>                        </td>
                      </tr>
					   <tr>
                        <td height="30" align="center" class="bigtext">&nbsp;</td>
                        <td height="30" class="bigtext">&nbsp;<input type="submit" name="Submit" value=" 修改幻灯片 " /><input name="picname" type="hidden" id="picname" value="<?php echo $row["pic"]; ?>" /></td>
					   </tr><?php }?>
                    </table>
                                    <br />
                  </form>
                  </td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
      
    </table></td>
  </tr>
</table>

</body>
</html>
<?php mysql_close($link);?>
